home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / util / arc / infozipi.lha / zip19Lxi / zip.doc < prev    next >
Text File  |  1992-11-16  |  24KB  |  538 lines

  1.  
  2. ZIP(1L)           MISC. REFERENCE MANUAL PAGES            ZIP(1L)
  3.  
  4. NAME
  5.      zip, zipcloak, zipnote,  zipsplit  -  package  and  compress
  6.      (archive) files
  7.  
  8. SYNOPSIS
  9.      zip   [-cdeEfghijklLmoqrTuwyz@]   [-b path]    [-n suffixes]
  10.      [-t mmddyy] [-x list] [ zipfile [ file1 file2 ...]]
  11.  
  12.      zipcloak [-dhL] [-b path] zipfile
  13.  
  14.      zipnote [-hwL] [-b path] zipfile
  15.  
  16.      zipsplit [-hitL] [-b path] zipfile
  17.  
  18. DESCRIPTION
  19.      zip is a compression and file packaging  utility  for  Unix,
  20.      VMS,  MSDOS,  OS/2,  Windows NT, Minix, Atari and Macintosh.
  21.      It is analogous to a combination of the UNIX commands tar(1)
  22.      and  compress(1)  and  is compatible with PKZIP (Phil Katz's
  23.      ZIP for MSDOS systems).
  24.  
  25.      A companion program (unzip(1L)), unpacks zip archives.   The
  26.      zip  and  unzip(1L) programs can work with archives produced
  27.      by PKZIP, and PKZIP and PKUNZIP can work with archives  pro-
  28.      duced  by  zip.   zip  version  1.9 is compatible with PKZIP
  29.      1.93a.  Note that PKUNZIP 1.10 cannot extract files produced
  30.      by  PKZIP  1.93a  or  zip 1.9. You must use PKUNZIP 1.93a or
  31.      unzip 5.0 (or later versions) to extract them.
  32.  
  33.      For a brief help on zip and unzip, run each without specify-
  34.      ing any parameters on the command line.
  35.  
  36.      The program is useful for packaging a set of files for  dis-
  37.      tribution; for archiving files; and for saving disk space by
  38.      temporarily compressing unused files or directories.
  39.  
  40.      The zip program puts one or more  compressed  files  into  a
  41.      single  zip  archive, along with information about the files
  42.      (name, path, date, time of  last  modification,  protection,
  43.      and  check information to verify file integrity).  An entire
  44.      directory structure can be packed into a zip archive with  a
  45.      single command.  Compression ratios of 2:1 to 3:1 are common
  46.      for text files.  zip has one compression method  (deflation)
  47.      and can also store files without compression.  zip automati-
  48.      cally chooses the better of the two  for  each  file  to  be
  49.      compressed.
  50.  
  51.      When given the name of an existing  zip  archive,  zip  will
  52.      replace  identically named entries in the zip archive or add
  53.      entries for new names.  For example, if foo.zip  exists  and
  54.      contains foo/file1 and foo/file2, and the directory foo con-
  55.      tains the files foo/file1 and foo/file3, then:
  56.  
  57.           zip -r foo foo
  58.  
  59.      will replace foo/file1  in  foo.zip  and  add  foo/file3  to
  60.      foo.zip.  After this, foo.zip contains foo/file1, foo/file2,
  61.      and foo/file3, with foo/file2 unchanged from before.
  62.  
  63.      If the file list is specified as -@, zip takes the  list  of
  64.      input  files  from  standard input.  Under UNIX, this option
  65.      can be used to  powerful  effect  in  conjunction  with  the
  66.      find(1)  command.   For example, to archive all the C source
  67.      files in the current directory and its subdirectories:
  68.  
  69.           find . -name "*.[ch]" -print | zip source -@
  70.  
  71.      (note that the pattern must be quoted to keep the shell from
  72.      expanding  it).  zip will also accept a single dash ("-") as
  73.      the zip file name, in which case it will write the zip  file
  74.      to  standard  output,  allowing  the  output  to be piped to
  75.      another program. For example:
  76.  
  77.           zip -r - . | dd of=/dev/nrst0 obs=16k
  78.  
  79.      would write the zip output  directly  to  a  tape  with  the
  80.      specified  block  size  for  the  purpose  of backing up the
  81.      current directory.
  82.  
  83.      zip also accepts a single dash ("-") as the name of  a  file
  84.      to  be  compressed, in which case it will read the file from
  85.      standard input, allowing zip to take input from another pro-
  86.      gram. For example:
  87.  
  88.           tar cf - . | zip backup -
  89.  
  90.      would compress the output of the tar command for the purpose
  91.      of backing up the current directory. This generally produces
  92.      better compression than the previous example  using  the  -r
  93.      option, because zip can take advantage of redundancy between
  94.      files. The backup can be restored using the command
  95.  
  96.           unzip -p backup | tar xf -
  97.  
  98.      When no zip file name is given and stdout is not a terminal,
  99.      zip acts as a filter, compressing standard input to standard
  100.      output.  For example,
  101.  
  102.           tar cf - . | zip | dd of=/dev/nrst0 obs=16k
  103.  
  104.      is equivalent to
  105.  
  106.           tar cf - . | zip - - | dd of=/dev/nrst0 obs=16k
  107.  
  108.      zip archives created in this manner can  be  extracted  with
  109.      the  program  funzip which is provided in the unzip package.
  110.      For example:
  111.  
  112.      dd if=/dev/nrst0  ibs=16k | funzip | tar xvf -
  113.  
  114.      When changing an existing zip archive, zip will write a tem-
  115.      porary  file with the new contents, and only replace the old
  116.      one when the process of creating the new  version  has  been
  117.      completed without error.
  118.  
  119. OPTIONS
  120.      -b path
  121.           Use the specified path for the temporary  zip  archive.
  122.           For example:
  123.  
  124.                zip -b /tmp stuff *
  125.  
  126.           will put the temporary zip  archive  in  the  directory
  127.           /tmp,  copying  over stuff.zip to the current directory
  128.           when done. This option is only useful when updating  an
  129.           existing  archive,  and the file system containing this
  130.           old archive does not have enough space to hold both old
  131.           and new archive at the same time.
  132.  
  133.      -c   Add one-line comments for each file.   File  operations
  134.           (adding, updating) are done first, and the user is then
  135.           prompted for a one-line comment for each  file.   Enter
  136.           the  comment  followed by return, or just return for no
  137.           comment.
  138.  
  139.      -d   Remove (delete) entries from a zip archive.  For  exam-
  140.           ple:
  141.  
  142.                zip -d foo foo/tom/junk foo/harry/\* \*.o
  143.  
  144.           will remove the entry foo/tom/junk, all  of  the  files
  145.           that  start  with foo/harry/, and all of the files that
  146.           end with .o (in any path).  Note  that  shell  pathname
  147.           expansion  has been inhibited with backslashes, so that
  148.           zip can see the asterisks, enabling zip to match on the
  149.           contents  of the zip archive instead of the contents of
  150.           the current directory.
  151.  
  152.           Under MSDOS, -d is case sensitive when it matches names
  153.           in  the  zip archive.  This requires that file names be
  154.           entered in upper case if they were zipped by  PKZIP  on
  155.           an MSDOS system.
  156.  
  157.      -e   Encrypt the contents of the zip archive using  a  pass-
  158.           word  which is entered on the terminal in response to a
  159.           prompt (this will not be echoed; if standard  error  is
  160.           not a tty, zip will exit with an error).
  161.  
  162.      -ee  Encrypt contents, prompting  for  the  password  twice,
  163.           checking  that  the  two  entries  are identical before
  164.           using the password.
  165.  
  166.      -f   Replace (freshen) an existing entry in the zip  archive
  167.           only  if  it  has  been modified more recently than the
  168.           version already in the zip archive; unlike  the  update
  169.           option  (-u)  this  will  not  add  files  that are not
  170.           already in the zip archive.  For example:
  171.  
  172.                zip -f foo
  173.  
  174.           This command should be run from the same directory from
  175.           which  the  original  zip  command was run, since paths
  176.           stored in zip archives are always relative.
  177.  
  178.      -g   Grow (append to) the specified zip archive, instead  of
  179.           creating  a  new  one.  If  this  operation  fails, zip
  180.           attempts to restore the archive to its original  state.
  181.           If the restoration fails, the archive might become cor-
  182.           rupted.
  183.  
  184.      -h   Display the zip help information (this also appears  if
  185.           zip is run with no arguments).
  186.  
  187.      -j   Store just the name of a saved file (junk the path). By
  188.           default,  zip will store the full path (relative to the
  189.           current path).
  190.  
  191.      -k   Attempt to convert the names and paths  to  conform  to
  192.           MSDOS,  store  only  the MSDOS attribute (just the user
  193.           write attribute from UNIX), and mark the entry as  made
  194.           under MSDOS (even though it was not); for compatibility
  195.           with PKUNZIP under MSDOS.
  196.  
  197.      -l   Translate the Unix end-of-line character  LF  into  the
  198.           MSDOS  convention CR LF. This option should not be used
  199.           on binary files.  This option can be used  on  Unix  if
  200.           the  zip  file  is intended for PKUNZIP under MSDOS. If
  201.           the input files already contain CR LF, this option adds
  202.           an extra CR. This ensure that unzip -a on Unix will get
  203.           back an exact copy of the original file,  to  undo  the
  204.           effect of zip -l.
  205.  
  206.      -ll  Translate the MSDOS end-of-line CR  LF  into  Unix  LF.
  207.           This  option  should not be used on binary files.  This
  208.           option can be used on MSDOS if the zip file is intended
  209.           for unzip under Unix.
  210.  
  211.      -L   Display the zip license.
  212.  
  213.      -m   Move the specified files into the  zip  archive;  actu-
  214.           ally,  this  deletes the target directories/files after
  215.           making  the  specified  zip  archive.  If  a  directory
  216.           becomes empty after removal of the files, the directory
  217.           is also removed. No deletions are done  until  zip  has
  218.           created  the archive without error.  This is useful for
  219.           conserving disk space, but is potentially dangerous and
  220.           should be used with care.
  221.  
  222.      -n suffixes
  223.           Do not attempt to compress files named with  the  given
  224.           suffixes. Such files are simply stored (0% compression)
  225.           in the output zip file, so that zip doesn't  waste  its
  226.           time   trying  to  compress  them.   The  suffixes  are
  227.           separated by either colons or semicolons.  For example:
  228.  
  229.                zip -rn .Z:.zip:.tiff:.gif:.snd  foo foo
  230.  
  231.           will copy everything from foo into  foo.zip,  but  will
  232.           store  any  files that end in .Z, .zip, .tiff, .gif, or
  233.           .snd without trying to compress them (image  and  sound
  234.           files  often  have  their  own  specialized compression
  235.           methods).  By default, zip does not compress files with
  236.           extensions  in  the  list  .Z:.zip:.zoo:.arc:.lzh:.arj.
  237.           Such files are stored directly in the  output  archive.
  238.           The  environment  variable ZIPOPT can be used to change
  239.           the default options. For example under Unix with csh:
  240.  
  241.                setenv ZIPOPT "-n .gif:.zip"
  242.  
  243.           (The variable ZIPOPT can be used for any option and can
  244.           include several options.) To attempt compression on all
  245.           files, use:
  246.  
  247.                zip -n : foo
  248.  
  249.           The  maximum  compression  option  -9   also   attempts
  250.           compression on all files regardless of extension.
  251.  
  252.      -o   Set the "last modified" time of the zip archive to  the
  253.           latest  (oldest)  "last  modified" time found among the
  254.           entries in the zip archive.  This can be  used  without
  255.           any other operations, if desired.  For example:
  256.  
  257.           zip -o foo
  258.  
  259.           will change the last modified time of  foo.zip  to  the
  260.           latest time of the entries in foo.zip.
  261.  
  262.      -q   Quiet mode; eliminate informational messages  and  com-
  263.           ment  prompts.   (useful, for example, in shell scripts
  264.           and background tasks).
  265.  
  266.      -r   Travel the directory structure recursively;  for  exam-
  267.           ple:
  268.  
  269.                zip -r foo foo
  270.  
  271.           In this case, all the files and directories in foo  are
  272.           saved  in  a zip archive named foo.zip, including files
  273.           with named starting with ".", since the recursion  does
  274.           not  use  the shell's file-name substitution mechanism.
  275.           You should not use -r with the name  ".*",  since  that
  276.           matches  ".."  which  will attempt to zip up the parent
  277.           directory (probably not what was intended).
  278.  
  279.      -t mmddyy
  280.           Do not operate on files modified prior to the specified
  281.           date,  where  mm  is the month (0-12), dd is the day of
  282.           the month (1-31), and yy are the last two digits of the
  283.           year.  For example:
  284.  
  285.                zip -rt 120791 infamy foo
  286.  
  287.           will add all the files in foo  and  its  subdirectories
  288.           that were last modified on or after 7 December 1991, to
  289.           the zip archive infamy.zip.
  290.  
  291.      -T   Test the integrity of the new zip file.  If  the  check
  292.           fails,  the  old zip file is unchanged and (with the -m
  293.           option) not input files are removed.
  294.  
  295.      -u   Replace (update) an existing entry in the  zip  archive
  296.           only  if  it  has  been modified more recently than the
  297.           version already in the zip archive.  For example:
  298.  
  299.                zip -u stuff *
  300.  
  301.           will add any new files in the  current  directory,  and
  302.           update any files which have been modified since the zip
  303.           archive stuff.zip was last created/modified (note  that
  304.           zip will not try to pack stuff.zip into itself when you
  305.           do this).
  306.  
  307.           Note that the -u option with no arguments acts like the
  308.           -f (freshen) option.
  309.  
  310.      -w   Append the version number of the  files  to  the  name,
  311.           including  multiple  versions  of  files.   (VMS  only;
  312.           default: use only the most recent version of  a  speci-
  313.           fied file).
  314.  
  315.      -x files
  316.           Explicitly exclude the specified files, as in:
  317.  
  318.                zip -r foo foo -x \*.o
  319.  
  320.           which will include the contents of foo in foo.zip while
  321.           excluding  all the files that end in .o.  The backslash
  322.           causes zip to match file names that were found when foo
  323.           was searched.
  324.  
  325.      -y   Store symbolic  links  as  such  in  the  zip  archive,
  326.           instead of compressing and storing the file referred to
  327.           by the link (UNIX only).
  328.  
  329.      -z   Prompt for a multi-line  comment  for  the  entire  zip
  330.           archive.   The  comment  is  ended by a line containing
  331.           just a period, or an end of file condition (^D on UNIX,
  332.           ^Z  on  MSDOS,  OS/2, and VAX/VMS).  The comment can be
  333.           taken from a file:
  334.  
  335.                zip -z foo < foowhat
  336.  
  337.      -#   Regulate the speed of compression using  the  specified
  338.           digit  #,  where -0 indicates no compression (store all
  339.           files), -1 indicates  the  fastest  compression  method
  340.           (less   compression)   and  -9  indicates  the  slowest
  341.           compression method (optimal  compression,  ignores  the
  342.           suffix list). The default compression level is -5.
  343.  
  344.      -@   Take the list of input files from standard input.
  345.  
  346. EXAMPLES
  347.      The simplest example:
  348.  
  349.           zip stuff *
  350.  
  351.      creates the archive stuff.zip (assuming it does  not  exist)
  352.      and  puts  all  the files in the current directory in it, in
  353.      compressed form (the .zip  suffix  is  added  automatically,
  354.      unless  that archive name given contains a dot already; this
  355.      allows the explicit specification of other suffixes).
  356.  
  357.      Because of the way the  shell  does  filename  substitution,
  358.      files  starting  with "." are not included; to include these
  359.      as well:
  360.  
  361.           zip stuff .* *
  362.  
  363.      Even this will  not  include  any  subdirectories  from  the
  364.      current directory.
  365.  
  366.      To zip up an entire directory, the command:
  367.  
  368.           zip -r foo foo
  369.  
  370.      creates the archive foo.zip, containing all  the  files  and
  371.      directories  in  the  directory foo that is contained within
  372.      the current directory.
  373.  
  374.      You may want to make a zip archive that contains  the  files
  375.      in  foo, without recording the directory name, foo.  You can
  376.      use the -j option to leave off the paths, as in:
  377.  
  378.           zip -j foo foo/*
  379.  
  380.      If you are short on disk space, you might  not  have  enough
  381.      room to hold both the original directory and the correspond-
  382.      ing compressed zip archive.  In this case,  you  can  create
  383.      the  archive  in steps using the -m option.  If foo contains
  384.      the subdirectories tom, dick, and harry, you can:
  385.  
  386.           zip -rm foo foo/tom
  387.           zip -rm foo foo/dick
  388.           zip -rm foo foo/harry
  389.  
  390.      where the first command creates foo.zip, and  the  next  two
  391.      add  to it.  At the completion of each zip command, the last
  392.      created archive is deleted, making room  for  the  next  zip
  393.      command to function.
  394.  
  395. PATTERN MATCHING
  396.      This section applies only to UNIX.   Watch  this  space  for
  397.      details on MSDOS and VMS operation.
  398.  
  399.      The UNIX shells (sh(1) and csh(1)) do filename  substitution
  400.      on command arguments.  The special characters are:
  401.  
  402.      ?    match any single character
  403.  
  404.      *    match any number of characters (including none)
  405.  
  406.      []   match any character in the range indicated  within  the
  407.           brackets (example: [a-f], [0-9]).
  408.  
  409.      When these characters are encountered (without being escaped
  410.      with  a  backslash or quotes), the shell will look for files
  411.      relative to the current path that  match  the  pattern,  and
  412.      replace the argument with a list of the names that matched.
  413.  
  414.      The zip program can do the same matching on names  that  are
  415.      in  the zip archive being modified or, in the case of the -x
  416.      (exclude) option, on the list of files to be operated on, by
  417.      using  backslashes or quotes to tell the shell not to do the
  418.      name expansion.  In general, when zip encounters a  name  in
  419.      the  list of files to do, it first looks for the name in the
  420.      file system.  If it finds it, it then adds it to the list of
  421.      files  to do.  If it does not find it, it looks for the name
  422.      in the zip archive being modified (if it exists), using  the
  423.      pattern  matching  characters  described  above, if present.
  424.      For each match, it will add that name to the list  of  files
  425.      to  be  processed.   File  names  following the -x (exclude)
  426.      option are removed from the processing list instead of being
  427.      added.
  428.  
  429.      The pattern matching includes the path, and so patterns like
  430.      \*.o  match  names that end in ".o", no matter what the path
  431.      prefix is.  Note that the backslash must precede every  spe-
  432.      cial  character  (i.e. ?*[]), or the entire argument must be
  433.      enclosed in double quotes ("").
  434.  
  435.      In general, use backslash to make zip do the pattern  match-
  436.      ing with the -f (freshen) and -d (delete) options, and some-
  437.      times after the  -x  (exclude)  option  when  used  with  an
  438.      appropriate operation (add, -u, -f, or -d).  The zip program
  439.      will never use pattern matching to search the  file  system.
  440.      If  it has recursively travelled a directory, all files (and
  441.      all directories) found there are fair game.
  442.  
  443. SEE ALSO
  444.      compress(1), shar(1L), tar(1), unzip(1L)
  445.  
  446. BUGS
  447.      zip 1.9 is not compatible with PKUNZIP 1.10. Use zip 1.1  to
  448.      produce zip files which can be extracted by PKUNZIP 1.10.
  449.  
  450.      zip files produced by zip 1.9 must not be updated by zip 1.1
  451.      or  PKZIP  1.10  or  PKZIP  1.93a, if they contain encrypted
  452.      members, or if they have been produced in a pipe or on a non
  453.      seekable  device.  The  old  versions  of zip or PKZIP would
  454.      create an archive with an incorrect format.   The  old  ver-
  455.      sions  can  list  the  contents  of  the zip file but cannot
  456.      extract it anyway (because  of  the  new  compression  algo-
  457.      rithm).   If  you do not use encryption and use regular disk
  458.      files, you do not have to care about this problem.
  459.  
  460.      zip 1.9 is compatible with  PKZIP  1.93a,  except  when  two
  461.      features  are used: encryption or zip file created in a pipe
  462.      or on a non seekable device. PKZIP versions above  2.0  will
  463.      support such files, and unzip 5.0 already supports them.
  464.  
  465.      Without -y when zip must compress a symbolic link to an  non
  466.      existing   file,  it  only  displays  a  warning  "name  not
  467.      matched". A better warning should be given.
  468.  
  469.      Under VMS, not all of the odd file formats are treated prop-
  470.      erly.   Only stream-LF format zip files are expected to work
  471.      with zip.  Others can be converted using Rahul Dhesi's  BILF
  472.      program.  This version of zip handles some of the conversion
  473.      internally.  When using Kermit to transfer  zip  files  from
  474.      Vax  to  MSDOS, type "set file type block" on the Vax.  When
  475.      transfering from MSDOS to Vax, type "set file type fixed" on
  476.      the  Vax.   In  both  cases,  type "set file type binary" on
  477.      MSDOS.
  478.  
  479.      Under VMS, zip hangs for file specification that uses DECnet
  480.      syntax foo::*.*.
  481.  
  482.      On OS/2, zip cannot match some names, such as those  includ-
  483.      ing  an  exclamation  mark or a hash sign.  This is a bug in
  484.      OS/2 itself: the 32-bit DosFindFirst/Next  don't  find  such
  485.      names.   Other programs such as GNU tar are also affected by
  486.      this bug.
  487.  
  488.      Under OS/2, the amount of External Attributes  displayed  by
  489.      DIR is (for compatibility) the amount returned by the 16-bit
  490.      version of DosQueryPathInfo(). Otherwise OS/2  1.3  and  2.0
  491.      would  report  different  EA sizes when DIRing a file.  How-
  492.      ever,  the  structure  layout   returned   by   the   32-bit
  493.      DosQueryPathInfo() is a bit different, it uses extra padding
  494.      bytes and link pointers (it's a linked  list)  to  have  all
  495.      fields  on  4-byte boundaries for portability to future RISC
  496.      OS/2 versions. Therefore the value reported  by  zip  (which
  497.      uses  this  32-bit-mode  size) differs from that reported by
  498.      DIR.  zip stores the 32-bit format for portability, even the
  499.      16-bit  MS-C-compiled  version  running on OS/2 1.3, so even
  500.      this one shows the 32-bit-mode size.
  501.  
  502. AUTHORS
  503.      Copyright (C) 1990-1992 Mark Adler, Richard B. Wales,  Jean-
  504.      loup  Gailly, Kai Uwe Rommel and Igor Mandrichenko.  Permis-
  505.      sion is granted to any individual  or  institution  to  use,
  506.      copy,  or  redistribute  this software so long as all of the
  507.      original files are included unmodified, that it is not  sold
  508.      for profit, and that this copyright notice is retained.
  509.  
  510.      LIKE ANYTHING ELSE THAT'S FREE, ZIP AND ITS ASSOCIATED UTIL-
  511.      ITIES  ARE  PROVIDED  AS IS AND COME WITH NO WARRANTY OF ANY
  512.      KIND, EITHER EXPRESSED OR IMPLIED.  IN  NO  EVENT  WILL  THE
  513.      COPYRIGHT  HOLDERS  BE LIABLE FOR ANY DAMAGES RESULTING FROM
  514.      THE USE OF THIS SOFTWARE.
  515.  
  516.      Please    send    bug    reports    and     comments     to:
  517.      zip-bugs@wkuvx1.bitnet.  For bug reports, please include the
  518.      version of zip, the make options used  to  compile  it,  the
  519.      machine  and operating system in use, and as much additional
  520.      information as possible.
  521.  
  522. ACKNOWLEDGEMENTS
  523.      Thanks to R. P. Byrne  for  his  Shrink.Pas  program,  which
  524.      inspired  this  project, and from which the shrink algorithm
  525.      was stolen; to Phil Katz for placing in  the  public  domain
  526.      the  zip  file format, compression format, and .ZIP filename
  527.      extension, and for accepting minor changes to the file  for-
  528.      mat; to Steve Burg for clarifications on the deflate format;
  529.      to Keith Petersen, Rich Wales, Hunter Goatley and Mark Adler
  530.      for  providing  a mailing list and ftp site for the INFO-ZIP
  531.      group to use; and most importantly, to  the  INFO-ZIP  group
  532.      itself  (listed in the file infozip.who) without whose tire-
  533.      less testing and bug-fixing efforts a portable zip would not
  534.      have  been  possible.   Finally  we should thank (blame) the
  535.      first INFO-ZIP moderator, David Kirschbaum, for  getting  us
  536.      into  this  mess  in  the  first place.  The manual page was
  537.      rewritten for UNIX by R. P. C. Rodgers.
  538.